package com.yunxi.service.dubboService.impl.sto;

import com.yunxi.sto.service.ReportPartnerYearDubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.lang.reflect.InvocationTargetException;
import com.yunxi.sto.pojo.ReportPartnerYearVO;
import java.util.Map;
import java.util.List;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunxi.service.localService.sto.ReportPartnerYearService;
import com.yunxi.model.sto.ReportPartnerYear;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Guan
 * @since 2020-03-09
 */
public class ReportPartnerYearDubboServiceImpl implements ReportPartnerYearDubboService {

    @Autowired
    @Qualifier(value = "reportPartnerYearServiceImpl")
    ReportPartnerYearService reportPartnerYearService;


    @Override
    public ReportPartnerYearVO getById(String id) throws InvocationTargetException, IllegalAccessException {
        ReportPartnerYear reportPartnerYear = reportPartnerYearService.getById(id);
        ReportPartnerYearVO reportPartnerYearVO = new ReportPartnerYearVO();
        BeanUtils.copyProperties(reportPartnerYear,reportPartnerYearVO);
        return reportPartnerYearVO;
    }

    @Override
    public void saveOrUpdate(ReportPartnerYearVO reportPartnerYearVO) throws InvocationTargetException, IllegalAccessException {
        ReportPartnerYear reportPartnerYear = new ReportPartnerYear();
        BeanUtils.copyProperties(reportPartnerYearVO,reportPartnerYear);
        reportPartnerYearService.saveOrUpdate(reportPartnerYear);
    }

    @Override
    public void removeById(String id) {
        reportPartnerYearService.removeById(id);
    }

    @Override
    public PageInfo<ReportPartnerYearVO> findPageByVO(ReportPartnerYearVO reportPartnerYearVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
        PageInfo<ReportPartnerYearVO> pageInfo = reportPartnerYearService.pageByVo(reportPartnerYearVO,pageNum,pageSize);
        return pageInfo;
    }

    @Override
    public void removeByListVo(List<ReportPartnerYearVO> reportPartnerYearVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        reportPartnerYearService.removeByListVo(reportPartnerYearVOList);
    }

    @Override
    public List listByVo(ReportPartnerYearVO reportPartnerYearVO) {
        return reportPartnerYearService.listByVo(reportPartnerYearVO);
    }
}
